package com.group4.highschoolportal.teacher.backingBeans;



import com.group4.controller.TeacherFacade;
import com.group4.entity.Teacher;
import com.group4.highschoolportal.teacher.backingBeans.TeacherBackingBean;
import com.group4.highschoolportal.loginBean.IndexBackingBean;
import java.io.Serializable;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author Victor Cernea
 */
@ManagedBean
@RequestScoped
public class TeacherHomeControllerBean implements Serializable {
    @ManagedProperty(value = "#{indexBackingBean}")
    private IndexBackingBean ib;
    
    private Teacher teacher;
    
    @ManagedProperty(value = "#{teacherBackingBean}")
    private TeacherBackingBean tb;
    
    @EJB
    TeacherFacade tdb;

    /** Creates a new instance of StudentHomeControllerBean */
    public TeacherHomeControllerBean() {
        System.out.print(tdb.findByLogin(ib.getUsername(), ib.getPassword()).toString());
        tb.setTeacher(tdb.findByLogin(ib.getUsername(), ib.getPassword()));
    }

    public Teacher getTeacher() {
        return teacher;
    }

    public void setTeacher(Teacher teacher) {
        this.teacher = teacher;
    }

    public IndexBackingBean getIb() {
        return ib;
    }

    public void setIb(IndexBackingBean ib) {
        this.ib = ib;
    }

    public TeacherFacade getTdb() {
        return tdb;
    }

    public void setTdb(TeacherFacade tdb) {
        this.tdb = tdb;
    }
    
    
    
}
